package newsEventSystem;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import newsEditor.NewsEditor;

import reader.Reader;

public class MainClass {

	private static void printMenu() {
		System.out.println("1.News Editor");
		System.out.println("2.Reader");
		System.out.println("3.Exit");
	}

	public static void main(String[] args) {
		printMenu();
		int option = 0;
		do {
			System.out.println("Please insert your option:");
			BufferedReader buffer = new BufferedReader(new InputStreamReader(
					System.in));
			try {
				option = Integer.parseInt(buffer.readLine().trim());
				switch (option) {
				case 1:
					new NewsEditor().start();
					break;
				case 2:
					new Reader().start();
					break;
				}
			} catch (NumberFormatException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			}
		} while (option != 3);
	}
}
